package com.atjglz.gmall.user.service.lmpl;

import com.atjglz.gmall.user.bean.UmsMember;
import com.atjglz.gmall.user.bean.UmsMemberReceiveAddress;
import com.atjglz.gmall.user.mapper.UmsMemberReceiveAddressMapperDao;
import com.atjglz.gmall.user.mapper.UserMapperDao;
import com.atjglz.gmall.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServicelmpl implements UserService {

    @Autowired
    UserMapperDao userMapperDao;
    @Autowired
    UmsMemberReceiveAddressMapperDao umsMemberReceiveAddressMapperDao;


    @Override
    public List<UmsMember> getAllUser() {
        List<UmsMember> umsNumberList = userMapperDao.selectAll();
        return umsNumberList;
    }

    @Override
    public List<UmsMemberReceiveAddress> selectAll(Integer memberId) {
        UmsMemberReceiveAddress umsMemberReceiveAddress = new UmsMemberReceiveAddress();
        umsMemberReceiveAddress.setMemberId(memberId);
        List<UmsMemberReceiveAddress> receiveAddresses = umsMemberReceiveAddressMapperDao.select(umsMemberReceiveAddress);
        return receiveAddresses;
    }
}
